package provider.controller;

import com.google.common.collect.Maps;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import provider.model.OrderModel;
import provider.model.entity.Order;
import provider.service.OrderFeignService;
import provider.service.UserFeignService;

import java.util.Collection;
import java.util.Date;
import java.util.HashMap;

@RestController
public class OrderController {

    private static final Logger logger = LoggerFactory.getLogger(OrderController.class);

    // 注入服务提供者,远程的Http服务
    @Autowired
    private OrderFeignService orderFeignService;

    // 服务消费者对位提供的服务
    @GetMapping("/sc/order/{id}")
    public String findByUserId(@PathVariable Long id) {
        OrderModel o=new OrderModel();

        return orderFeignService.findByUserId(id);
    }

}